import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false
import "./assets/css/iconfont.css"
//注册全局组件
import page from "./components/page.vue"
Vue.component("page",page)
import pageHeader from "./components/pageHeader.vue"
Vue.component("pageHeader",pageHeader)
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper);

import axios from 'axios';
Vue.prototype.$http=axios.create({
  baseURL:"https://www.softeem.xin"
});

//在vue的原型上边扩展的两个方法
//如果在原型上扩展可以直接通过this调用
Vue.prototype.showLoading=function(title){
  this.$store.dispatch("showLoading",title);
}
Vue.prototype.hideLoading=function(){
  this.$store.dispatch("hideLoading");
}
Vue.prototype.showActionSheet=function(config){
  this.$store.dispatch("showActionSheet",config)
}
Vue.prototype.hideActionSheet=function(){
  this.$store.dispatch("hideActionSheet")
}

Vue.prototype.showPreviewImage=function(config){
  this.$store.dispatch("showPreviewImage",config)
}
Vue.prototype.hidePreviewImage=function(){
  this.$store.dispatch("hidePreviewImage")
}

//图片懒加载
import VueLazyload from 'vue-lazyload'
import loadImage from './assets/imags/loadingimg.gif'
Vue.use(VueLazyload,{
loading:loadImage
})
//第三方消息交互插件
import {Alert,Confirm,Toast} from 'wc-messagebox'
import 'wc-messagebox/style.css'
Vue.use(Alert)
Vue.use(Confirm)
Vue.use(Toast)

import viewContent from "./components/viewContent.vue"
Vue.component("viewContent",viewContent)

//加载全局扩展方法
import "./utils/methodExtend.js"

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
